<%@ include file="/taglibs.jsp"%>
<head>
<title><c:if test="${empty param.id}">
		<fmt:message key="userForm.add.title" />
	</c:if> <c:if test="${not empty param.id}">
		<fmt:message key="userForm.edit.title" />
	</c:if></title>
</head>

<p>
	<fmt:message key="detailForm.header" />
</p>

<s:form name="userForm" action="updateUser" method="post">
	<s:hidden name="user.id" value="%{user.id}" />
	<tr>
		<td>
	        <s:property value="getText('user.username')"/><span class="required">*</span>
	    </td>
	    <td>
	    	<s:textfield maxlength="30" key="user.username" required="true"
		size="15" theme="simple"/>
	    </td>
	</tr>
	
	<tr>
		<td>
	        <s:property value="getText('user.firstName')"/><span class="required">*</span>
	    </td>
	    <td>
	    	<s:textfield maxlength="30" key="user.firstName" required="true"
		size="30" theme="simple" />
	    </td>
	</tr>
	<tr>
		<td>
	        <s:property value="getText('user.lastName')"/><span class="required">*</span>
	    </td>
	    <td>
	    	<s:textfield maxlength="30" key="user.lastName" required="true"
		size="20" theme="simple" />
	    </td>
	</tr>
	<s:if test="user.id ==null">
							
		<tr>
			<td>
		        <s:property value="getText('password')"/><span class="required">*</span>
		    </td>
		    <td>
		    	<s:password  key="password" maxlength="20" size="20" required="true" theme="simple"/>
		    </td>
		</tr>
		<tr>
			<td>
		        <s:property value="getText('confirmPassword')"/><span class="required">*</span>
		    </td>
		    <td>
		    	<s:password  key="confirmPassword" maxlength="20" size="20" required="true" theme="simple"/>
		    </td>
		</tr>
	</s:if>
	<s:if test="user.id !=null">
		<tr>
			<td>
		        <s:property value="getText('password')"/><span class="required">*</span>
		    </td>
		    <td>
		    	<s:password  key="password" value="******" showPassword="true" maxlength="20" size="20" required="true" theme="simple"/>
		    </td>
		</tr>
		<tr>
			<td>
		        <s:property value="getText('confirmPassword')"/><span class="required">*</span>
		    </td>
		    <td>
		    	<s:password  key="confirmPassword" value="******" showPassword="true" maxlength="20" size="20" required="true" theme="simple"/>
		    </td>
		</tr>	
	</s:if>
	
	<tr>
		<td>
	        <s:property value="getText('user.phone')"/>
	    </td>
	    <td>
	    	<s:textfield maxlength="30" key="user.phone" size="15" theme="simple"/>
	    </td>
	</tr>
	<tr>
		<td>
	        <s:property value="getText('user.email')"/>
	    </td>
	    <td>
	    	<s:textfield maxlength="50" key="user.email" size="30" theme="simple"/>
	    </td>
	</tr>
	<tr>
		<td>
	        <s:property value="getText('user.tel')"/>
	    </td>
	    <td>
	    	<s:textfield maxlength="30" key="user.tel" size="15" theme="simple"/>
	    </td>
	</tr>

	<br />

	<tr>
		<td colspan="2">
				<button type="submit" class="button" name="save"
					onclick="this.blur()">
					<fmt:message key="button.save.title"></fmt:message>
					<img src="${ctx}/images/btn_save.png" align="left" height="20"
						width="20">
				</button>
			
			<button type="submit" class="button" name="cancel"
				onclick="form.onsubmit=null">
				<fmt:message key="button.cancel.title"></fmt:message>
				<img src="${ctx}/images/btn_cancel.png" align="left" height="20"
					width="20">
			</button></td>
	</tr>
</s:form>

